package objbo.xmlparser.controls.action;

import objbo.xmlparser.model.bean.ElementBean;
import objbo.xmlparser.view.interfaces.ElementInterFace;
import objbo.xmlparser.view.interfaces.UIInterFace;
import objbo.xmlparser.view.ui.XMLTreeUI;

import org.eclipse.jface.action.Action;

public class XMLTreeSelectAction extends Action
{
	private UIInterFace uIInterFace = null;
	private ElementInterFace elementInterFace = null;
	private XMLTreeUI ui = null;
	public XMLTreeSelectAction(ElementInterFace elementInterFace, UIInterFace uIInterFace)
	{
		this.elementInterFace = elementInterFace;
		this.uIInterFace = uIInterFace;
	}
	
	public void setXMLTreeUI(XMLTreeUI ui)
	{
		 this.ui = ui;
	}
	
	@Override
	public void run()
	{
		ElementBean elementBean = ui.getSelectioElementBean();
		if(elementBean != null)
		{
			uIInterFace.setTabElementData(elementBean);
		}
		
		//super.run();
		
	}
}
